
//#include	<reg52.h>
#include "stc11fxx.h"



#define _sxIO_H__

/* modify this according to I2C device address when you use standard I2C function like I2C_XXXX except AI2C_XXXX*/
//#define I2C_DEV0_ADDRESS 0xa0
#define I2C_DEV0_ADDRESS 0x58

#define I2C_TIMEOUT_TIME    10
#define I2C_TIMEOUT_COUNT    8
#define MS_DELAY_CONST    40
/************end*********************/



/****************************************************************************************************************************
** The following routines is for LPC214X ARM I/O definition. It is just as reference for program using 2-wire and 3-wire bus.
** Pls make a further revision for your routines according to the following type.
****************************************************************************************************************************/


//#define SDA P1_7
//#define SCL P1_6


#define SDA P1_6
#define SCL P1_7




/***************************************************************************************************/

extern UINT8 ChipReset(UINT8 Slave) ;



extern UINT8 sxD_ReadReg(UINT8 adr);
extern UINT8 sxD_WriteReg(UINT8 adr, UINT8 value);



/** the following functions is for other I2C devices rather than sx161X ***/
extern UINT8 sxD_I2C_WRITE(UINT8 Regis_Addr,UINT8 Data);
extern UINT8 sxD_I2C_READ(UINT8 Regis_Addr);
extern UINT8 sxD_I2C_NREAD(UINT8 Regis_Addr, UINT8 *buf, UINT8 n);
extern UINT8 sxD_I2C_NWRITE(UINT8 Regis_Addr, UINT8 *buf, UINT8 n);
